jQuery(document).ready(function () {
                    jQuery('#KarenTableContainer').jtable({
                        title: 'Roles',
                        actions: {
                            listAction: 'rol',
                            createAction: '/algo',
                            updateAction: '/algo',
                            deleteAction: '/algo'
                        },
                        fields: {
                            PersonId: {
                                key: true,
                                create: false,
                                edit: false,
                                list: false
                            },
                            Nombre: {
                                title: 'Nombre',
                                width: '30%'
                            },
                            Descripcion: {
                                title: 'Descripcion',
                                width: '60%',
                                type: 'textarea'
                            },
                            General: {
                                title: 'Privilegios',
                                width: '10%',
                                sorting: false,
                                edit: false,
                                create: false,
                    display: function (data) {
                        //Create an image that will be used to open child table
                        var $img = $('<input type="button" value="Ver" />');
                        //Open child table when user clicks the image
                        $img.click(function () {
                            $('#KarenTableContainer').jtable('openChildTable',
                                    $img.closest('tr'),
                                    {
                                        title:'Privilegios',
                                        actions: {
                                            listAction: 'privilegio',
                                            createAction: '/algo',
                                            updateAction: '/algo'
                                        },
                                        fields: {
                                            PersonId: {
                                                key: true,
                                                create: false,
                                                edit: false,
                                                list: false
                                            },
                                            Accion: {
                                title: 'Accion',
                                width: '50%'
                                
                            },
                            Permiso: {
                                title: 'Permiso',
                                width: '50%',
                                type: 'checkbox',
                                values: { 'false': 'Deshabilitado', 'true': 'Habilitado' },
                                defaultValue: 'false'
                            }               
                          }
                                    }, function (data) { //opened handler
                                        data.childTable.jtable('load');
                                    });
                        });
                        //Return image to show on the person row
                        return $img;
                    }
                }
                        }
                    });

                    jQuery('#KarenTableContainer').jtable('load');
                });